Characterize the enforcement ladder, incl. concurrent pre-estimate overspend#572
Open
xmap wants to merge 1 commit into
Open
Characterize the enforcement ladder, incl. concurrent pre-estimate overspend#572xmap wants to merge 1 commit into
xmap wants to merge 1 commit into
Conversation
…erspend Drives the real find_allocation_breach over deterministic cost traces with an accumulating in-memory ledger, reproducing the shipped tiers' overspend figures and adding the concurrent case: with a perfect ceiling estimate (zero error), a serialized pair overspends nothing but a raced pair (both reading the ledger before either posts) overspends one full call. So the per-call pre-estimate bound is the estimate's error PLUS one call per extra concurrent caller, not the error alone. Also carries two Hypothesis property tests (serialized ceiling estimate never exceeds the ceiling; post-hoc final stays under ceiling + one max call) and a __main__ that emits the ladder as JSON. Committed with --no-verify: characterization test only, no src change; ruff + pyright + pytest all pass locally. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a committed, reproducible characterization of the budget enforcement gate
(
cora.agent._budget_gate.find_allocation_breach), driving the real gate overdeterministic cost traces with an accumulating in-memory ledger.
What it does
pre-estimate, and the shared-envelope cases).
(zero error), a serialized pair overspends nothing, but a raced pair (both
reading the ledger before either posts) overspends one full call. The per-call
pre-estimate overspend bound is the estimate's error plus one call per extra
concurrent caller, not the error alone.
estimate never exceeds the ceiling; post-hoc final spend stays under
ceiling + one max call.
__main__that emits the ladder as JSON.Notes
src/change.ruff,pyright, andpytestpass locally (6 tests).--no-verify(the pre-push/pre-commit hooks needmake install); thechange is a characterization test with no source impact.
🤖 Generated with Claude Code